package com.kdg.thread.abstractquenesynchronizer;

import com.alibaba.fastjson.JSON;
import com.kdg.Animal;
import com.kdg.CatTest;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.CyclicBarrier;
import java.util.concurrent.locks.ReentrantLock;

/**
 * AQS介绍
 */
public class AbstractQuenedSynchronizer {

    public static void main(String[] args) {
        ReentrantLock reentrantLock = new ReentrantLock();
        CountDownLatch countDownLatch = new CountDownLatch(3);
        CyclicBarrier cyclicBarrier = new CyclicBarrier(3);

        CatTest catTest = new CatTest();
        catTest.setCatName("catName");
        catTest.setCatColor("catColor");
        Animal animal = new Animal("color","animal",catTest);
        String str = JSON.toJSONString(animal);
        Animal animal1 = JSON.parseObject(str, Animal.class);
        System.out.println(str);
        System.out.println(animal1.getCat().getCatColor());
    }
}


